﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NJT.ValueConverter;

namespace NJT.Test.ValueConverter
{


    [TestClass]
    public class LongTo文件大小test
    {
        [TestMethod]
        public void LongTo文件大小_test()
        {
            var b = new LongTo文件大小();

            Assert.AreEqual("1.00 KB", b.Convert((long)1024, typeof(string), null, CultureInfo.CurrentCulture));
            Assert.AreEqual("1.00 MB", b.Convert((long)1024 * 1024, typeof(string), null, CultureInfo.CurrentCulture));
            Assert.AreEqual("1.00 GB", b.Convert((long)1024 * 1024 * 1024, typeof(string), null, CultureInfo.CurrentCulture));
            Assert.AreEqual("1.50 KB", b.Convert((long)1536, typeof(string), null, CultureInfo.CurrentCulture));

        }

    }
}
